<?php
    define('YC', "YCBOT");
    date_default_timezone_set("Asia/Ho_Chi_Minh");
    require_once("func.php");
    require_once("config.php");
    require_once(BASE."subsystems/database.php");
    $db = exponent_database_connect(DB_USER,DB_PASS,DB_HOST.':'.DB_PORT,DB_NAME);
    $a=$db->selectObject('setting',"id=1");
    SureRemoveDir(BASE.'tmp/',false);
    $cache=$db->selectObjects('cache','1');
    if (!is_dir(BASE.'tmp/cache/')) {
        mkdir(BASE.'tmp/cache/');
    }
    foreach($cache as $k=>$v)
    {
        $FileName = $v->id;
        $FileHandle = fopen($FileName, 'w') or die("can't open file");
        fwrite($FileHandle, $v->out_text);
        fclose($FileHandle);
    }

    print_r($a);




?>
